package com.example.demo.service.impl;

import com.example.demo.dao.UserDao;
import com.example.demo.pojo.User;
import com.example.demo.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;

/**
 * @Author 翁佃峰
 */
@Service
public class UserServiceImpl implements UserService {

    @Resource
    UserDao userDao;

    @Override
    public ArrayList<User> getUserList() {
        return userDao.getUserList();
    }

    @Override
    public void deleteUserById(String id) {
        userDao.deleteUserById(id);
    }

    @Override
    public void updateUser(User user) {
        userDao.updateUser(user);
    }

    @Override
    public void addUser(User user) {
        userDao.addUser(user);
    }

    @Override
    public void addMultipleUsers(List<User> users) {
        userDao.addMultipleUsers(users);
    }

    @Override
    public void deleteMultipleUsers(String[] id) {
        userDao.deleteMutipleUsers(id);
    }

    @Override
    public List<User> getMultipleUsersById(String[] id) {
        return userDao.getMultipleUsersById(id);
    }

    @Override
    public List<User> getUserByCondition(User user) {
        return userDao.getUserByCondition(user);
    }

    @Override
    public void setUserByCondition(User user) {
        userDao.setUserByCondition(user);
    }

}
